
package gov.chinatax.ctcps.generator.form;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for dmJhwz.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="dmJhwzForm"
 */
public class DmJhwzForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _jhwzDm = null;
   private java.lang.String _jhwzMc = null;

   /**
    * Standard constructor.
    */
   public DmJhwzForm() {
   }

   /**
    * Returns the jhwzDm
    *
    * @return the jhwzDm
    */
   public java.lang.String getJhwzDm() {
      return _jhwzDm;
   }

   /**
    * Sets the jhwzDm
    *
    * @param jhwzDm the new jhwzDm value
    */
   public void setJhwzDm(java.lang.String jhwzDm) {
      _jhwzDm = jhwzDm;
   }
   /**
    * Returns the jhwzMc
    *
    * @return the jhwzMc
    */
   public java.lang.String getJhwzMc() {
      return _jhwzMc;
   }

   /**
    * Sets the jhwzMc
    *
    * @param jhwzMc the new jhwzMc value
    */
   public void setJhwzMc(java.lang.String jhwzMc) {
      _jhwzMc = jhwzMc;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getJhwzDm() == null) {
         errors.add("jhwzDm", new ActionError("error.jhwzDm.required"));
      }
      // TODO test format/data
      return errors;
   }
}
